<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background-color: crimson;
            position: absolute;
            top: 0px;
            left: 0px;
        }
    </style>
</head>
<body>
    <div></div>
    <script>
        
        function animationFrame(target){
            var ele = document.querySelector("div");
            var num = parseInt(getComputedStyle(ele)['left']);
            console.log(num);
            num += 1 ; 
            console.log(num,target);
            if ( num < target ){
                ele.style['left'] = num + 'px' ;
                requestAnimationFrame(animationFrame);
            } else {
                return  ;
            }
        }
        // console.log(divEle);
        animationFrame(200);
    </script>
</body>
</html>